First Applications :  Maximum area of a rectangle with a certain perimeter p.

Given a length p form a rectangle that has a maximum area.  Explore the rectangle and write your comment.

(*p=12;areaRectangle[x_]=x (p/2-x);
maxA=FindMaximum[areaRectangle[b],{b,2}];
b/.Last[FindMaximum[areaRectangle[b],{b,2}]];
areamax=maxA[[1]];
bmax=maxA[[2,1,2]];()

ClearAll["Global[`*"];

Manipulate[

Column[{
Item[Style[Row[{Style["\nCalculate the dimensions that maximize the area of\n a rectangle if its perimeter is ",Italic],TraditionalForm[p,{4,2}],Style[" feet \n",Italic]}],16,Purple],Frame->True,Alignment->{Center}],
Item[
areaRectangle[x_]=x (p/2-x);
height=p/2-b;
maxA=FindMaximum[areaRectangle[b],{b,2}];
bmax=maxA[[2,1,2]];
maxArea=maxA[[1]];

areaPlot=Plot[areaRectangle[x],{x,0,5},PlotStyle->{Thick,Blue},PlotRange->{{0,5.7},Automatic},AxesLabel->{Style[ width ,12],Style["Content Area",12]},PlotLabel->Style[Row[{"Area of Rectangle"}],18],ImageSize->Medium];
pointOnCurve=If[showMax,Graphics[{PointSize[0.035],Red,Point[{bmax,maxArea}]}],
Graphics[{PointSize[Large],Black,Point[{b,areaRectangle[b]}]}]];
rectangle=
If[showMax,Graphics[{EdgeForm[Blue],FaceForm[Pink],Rectangle[{0,0},{bmax,bmax}],Line[{{0,0},{0,-0.8}}],Line[{{bmax,0},{bmax+0.8,0}}],
Line[{{bmax,0},{bmax,-0.8}}],Line[{{bmax,p/2-bmax},{bmax+0.8,p/2-bmax}}],{Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{bmax,-0.7}}],Arrow[{{bmax+0.7,0},{bmax+0.7,p/2-bmax}}]},
If[answer,{Text[Style[Row[{Style["area",Italic]," = ",NumberForm[maxArea,{3,2}],Superscript[ft,2]}],16,Black],{bmax/2,(p/2-bmax)/2}],Text[Style[Row[{Style["width",Italic]," = ",NumberForm[bmax,{3,2}],Style[" ft"]}],12,Purple],{bmax/2,-0.5}],Rotate[Text[Style[Row[{Style["height",Italic]," = ",NumberForm[bmax,{3,2}],Style[" ft"]}],12,Purple],{bmax+0.5,bmax/2.}],π/2]},Text[Style[Row[{Style["area",Italic]," = ? ",Superscript[ft,2]}],16,Black],{bmax/2,(p/2-bmax)/2}]]},Axes->True,PlotRange->{{0,5},{-1,6}}],Graphics[{EdgeForm[Red],FaceForm[Yellow],Rectangle[{0,0},{b,p/2-b}],
Line[{{0,0},{0,-0.8}}],Line[{{b,0},{b+0.8,0}}],
Line[{{b,0},{b,-0.8}}],Line[{{b,p/2-b},{b+0.8,p/2-b}}],{Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{b,-0.7}}],Arrow[{{b+0.7,0},{b+0.7,p/2-b}}]},
If[answer,{Text[Style[Row[{Style["area",Italic]," = ",NumberForm[b (p/2-b),{3,2}],Superscript[ft,2]}],16,Black],{b/2,(p/2-b)/2}],Text[Style[Row[{Style["width",Italic]," = ",NumberForm[b,{3,2}],Style[" ft"]}],12,Purple],{b/2,-0.5}],Rotate[Text[Style[Row[{Style["height",Italic]," = ",NumberForm[height,{3,2}],Style[" ft"]}],12,Purple],{b+0.5,height/2.}],π/2]},{Text[Style[Row[{Style["area",Italic]," = ? ",Superscript[ft,2]}],16,Black],{b/2,(p/2-b)/2}],Text[Style[Row[{Style["width",Italic]," = ?",Style[" ft"]}],12,Black],{b/2,-0.5}],Rotate[Text[Style[Row[{Style["height",Italic]," = ?",Style[" ft"]}],12,Black],{b+0.5,height/2.}],π/2]}]



},PlotRange->{{0,5},{-1,6}},Axes->True]];

Row[{Show[rectangle,ImageSize->Medium,PlotRange->{{0,5.5},{-1.1,6}}],Show[areaPlot,pointOnCurve,ImageSize->Medium]
}],Frame->True]
}],

Row[{Control[
{{p,12.,"Perimeter"},6,15.,ImageSize->Tiny,Appearance->"Labeled"}],Control[
{{b,2.,"window width, x"},0.42,4.5,ImageSize->Tiny,Appearance->"Labeled"}],Spacer[30],Control[{{showMax,False,"show Max"},{False,True}}],Control[{{answer,False,"Answer"},{False,True}}]}],TrackedSymbols->True]

Area of a side view of a garage
 (a rectangle topped by isosceles triangle):

Given :
 	1.  a perimeter of the side of a garage. 
	2. the ratio between the height and the width of the rectangle,
	3. the measure of the vertex angle of the top triangle.
a) Calculate the dimensions of the side of the garage and its area. 
b) Explore the measure of the vertex angle that yields maximum area under the
      given perimeter and ratio.

ClearAll["Global`*"];

Manipulate[
(* Let α = alpha be the vertex angle of the top triagle and p = perimeter of the garage,
let ratio = (height/width) of the rectangle. Hence the area of the garage in terms of α is:  *)
(*area[u_]=(p^2 u (4. ratio  u + (Sqrt[Abs[1. - u^2]])))/(4(u+2 ratio u +1)^2);*)
area1[α_]=(p^2 Sin[α/2] (4. ratio  Sin[α/2] + Cos[α/2]))/(4(Sin[α/2]+2 ratio Sin[α/2]+1)^2);
max=FindMaximum[{area1[x],π/6<x≤π},{x,π/3}];
alphamax1=max[[2,1,2]];

If[alpha>alphamax1,alpha=alphamax1];
(* The vertex angle = alpha *)
x=Sin[alpha/2];
(* The width of the rectangle b in terms of the perimeter and sin( alpha ) is:*)
b=p x /(x + 2 ratio x + 1.);
(* Height of the triangle   height/(b/2)=cot(alpha) 
Therefore height = (b/2) cos(alpha)/sin(alpha)*)
rise= b Cos[alpha/2]/(2. x);
totalheight=b ratio +rise;
(* pitch = rise/span = rise/width b *)
pitch=rise/b;
maxrise= b (Cos[alphamax1/2])/(2 Sin[alphamax1/2]);
pitchmax=maxrise/b;
totalmaxheight=b ratio +maxrise;
Column[{
Item[Style[Row[{Style["\nCalculate the dimensions and the area of the figure\nif its perimeter = ",Italic],TraditionalForm[p,{4,2}],Style[" feet ",Italic]," ",Style[" and the vertex angle",Italic]," = ",Superscript[alpha 180/π,°],"\n"}],16,Black],Frame->True,Alignment->{Center},ItemSize->{52,3}],
Item[

pltarea1=Plot[area1[alpha],{alpha,0,π},(*PlotRange->{{-π/9,10 π/9},{-3,18}},*)PlotLabel->Style[Row[{Style["Perimeter",Italic]," = ",p,Style[" feet",Italic]}],16],AxesLabel->{Style["Vertex\n angle",Medium,Bold,Italic],Style["Area",Medium,Bold,Italic]},
AxesStyle->{{Arrowheads[{0.04}],Directive[Thick,Italic,Black,14]},{Arrowheads[{0.04}],Directive[Thick,Italic,Black,14]}},

GridLines->{Range[0,10π/9,π/18],Automatic},GridLinesStyle->Directive[GrayLevel[0.5]],Ticks->{{{Pi/9,20°},{2Pi/9,40°},{Pi/3,60°},{4Pi/9,80°},{5Pi/9,100°},{2Pi/3,120°},{7Pi/9,140°},{8Pi/9,160°},{Pi,180°}},Automatic}];

maxpt1=Graphics[{PointSize[0.02],Red,Point[{alphamax1,area1[alphamax1]}]}];
greenpt1=Graphics[{Darker[Green],PointSize[0.025],Point[{alpha,area1[alpha]}]}];


garage=Graphics[{{EdgeForm[{Thick,Red}],FaceForm[Orange],Opacity[0.3],Polygon[{{0,0},{0,ratio b},{ b/2,b ratio+rise},{b,ratio b},{b,0}}]},

Line[{{0,0},{0,-0.8}}],Line[{{b,0},{b,-0.8}}],
Line[{{b,0},{b+1.2,0}}],Line[{{ b,ratio b},{ b+0.8,ratio b}}],
Line[{{ b/2,ratio b+rise},{ b+1.2,ratio b+rise}}],
Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{b,-0.7}}],Arrow[{{b+0.7,0},{b+0.7,ratio b}}],Arrow[{{b+0.7,ratio b},{b+0.7,ratio b+rise}}],Arrow[{{b+1.1,0},{b+1.1,ratio b + rise}}],
If[answer,{Text[Style[Row[{Style["width",Italic]," = ",NumberForm[b,{4,3}],Style[" ft"]}],12,Purple],{b/2,-0.5}],Text[Style[Row[{Style["height",Italic]," = ",NumberForm[ratio b,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,ratio b/2.}],

Text[Style[Row[{Style["roof's height",Italic],"\n = ",NumberForm[rise,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,ratio b+rise/2.}],
Rotate[Text[Style[Row[{Style["total height",Italic],"\n = ",NumberForm[totalheight,{4,3}],Style[" ft"]}],12,Purple],{b+1.1,(ratio b+rise)/2-0.3}],π/2]
},{
Text[Style["width = ?",14],{b/2,-0.5}],Text[Style["height = ?",14],{b+0.5,ratio b/2.}],Text[Style["roof's height\n = ?",14],{b+0.5,ratio b+rise/2.}],Rotate[Text[Style[Row[{Style["total height",Italic],"\n = ?",Style[" ft"]}],12,Black],{b+1.1,(ratio b+rise)/2}],π/2]
}],
(*  Write the area of the garage *)
{Text[Style[Superscript[alpha 180/π,°],16,Black],{b/2,b ratio+rise-0.5}],If[answer,
Text[Style[Row[{Style["area of fig.",Italic],"\n = ",NumberForm[area1[alpha],{5,3}],"  ",Superscript[ft,2] }],16,Black],{b/2,ratio b-0.6}]]}
  },Axes->True,PlotRange->{{0,5.2},{-1.5,6}},AspectRatio->Automatic,ImageSize->{250,250}];

garagemax=
Graphics[{{EdgeForm[{Thick,Blue}],FaceForm[Pink],Opacity[0.5],Polygon[{{0,0},{0,ratio b},{b /2,b ratio+maxrise},{b,b ratio},{b,0}}]},
Line[{{0,0},{0,-0.8}}],Line[{{b,0},{b,-0.8}}],
Line[{{b,0},{b+1.2,0}}],Line[{{ b,ratio b},{ b+0.8,ratio b}}],
Line[{{ b/2,ratio b+ maxrise},{ b+1.2,ratio b+maxrise}}],
(*Line[{{b,0},{b+1.2,0}}],Line[{{ b,ratio b},{ b+1.2,ratio b}}],*)
Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{b,-0.7}}],Arrow[{{b+0.7,ratio b},{b+0.7,ratio b+maxrise}}],Arrow[{{b+0.7,0},{b+0.7,ratio b}}],Arrow[{{b+1.1,0},{b+1.1,ratio b + maxrise}}],

(*  Write the maximum area of the garage *)
If[answer,{Text[Style[Row[{Style["area of fig.",Italic],"\n = ",NumberForm[area1[alphamax1],{5,3}],"  ",Superscript[ft,2] }],16,Black],{b/2,ratio b-0.6}],
Text[Style[Row[{Style["     width",Italic]," = ",NumberForm[b,{4,3}],Style[" ft"]}],12,Purple],{b/2,-0.5}],Text[Style[Row[{Style["     height",Italic]," = ",NumberForm[ratio b,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,ratio b/2.}],
Text[Style[Row[{Style["     roof's height",Italic],"\n = ",NumberForm[maxrise,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,ratio b+maxrise/2.}],
Rotate[Text[Style[Row[{Style["   total height",Italic],"\n   = ",NumberForm[totalmaxheight,{4,3}],Style[" ft"]}],12,Purple],{b+1.1,ratio b-0.2}],π/2]

}],Text[Style[Superscript[alphamax1 180/π,°],16,Black],{b/2,b ratio+maxrise-0.5}]  },Axes->True,PlotRange->{{0,5.5},{-1.5,6}},ImageSize->Medium];
(*Show[pltarea,maxpt]*)
If[showmax,Row[{Show[garagemax,ImageSize->Large],Column[{

Row[{"\n",Style["Dimensions:",24,Italic]}],
Style[Row[{Style["     width           ",Italic]," = ",NumberForm[b,{5,3}],"  ft"}],18],
Style[Row[{Style["     pitch            ",Italic]," = ",NumberForm[pitchmax,{5,3}]}],18],
Style[Row[{Style["     max. rise     ",Italic]," = ",NumberForm[maxrise,{5,3}]," ft."}],18],Style[Row[{Style["     max height  ",Italic]," = ",NumberForm[b ratio,{5,3}]," ft."}],18],
Style[Row[{Style["   total height  ",Italic],"   = ",NumberForm[totalmaxheight,{5,3}]," ft."}],18],
Style[Row[{Style["area of fig.",Italic]," = ",NumberForm[area1[alphamax1],{5,3}],"  ",Superscript[ft,2] }],24,Italic,Black],
Spacer[{0,12}],
Show[pltarea1,maxpt1,ImageSize->Medium]
}]
}],
Row[{Show[garage,ImageSize->475],If[answer,Column[{
Row[{"\n",Style["Dimensions:",24,Italic]}],
Style[Row[{Style["     width         ",Italic]," = ",NumberForm[b,{5,3}],"  ft"}],18],
Style[Row[{Style["     pitch          ",Italic]," = ",NumberForm[pitch,{5,3}]}],18],
Style[Row[{Style["     rise            ",Italic]," = ",NumberForm[rise,{5,3}]," ft."}],18],
Style[Row[{Style["     height        ",Italic]," = ",NumberForm[b ratio,{5,3}]," ft."}],18],
Style[Row[{Style["   total height",Italic],"   = ",NumberForm[totalheight,{5,3}]," ft."}],18],
Style[Row[{Style["area of fig.",Italic]," = ",NumberForm[area1[alpha],{5,3}],"  ",Superscript[ft,2] }],24,Italic,Black],
Spacer[{0,12}],
Show[pltarea1,greenpt1,ImageSize->Medium]
}],
Column[{
Row[{"\n",Style["Dimensions:",24,Italic,White]}],
Style[Row[{Style["     width         ",Italic,White]," = ",NumberForm[b,{5,3}],"  ft"}],18,White],
Style[Row[{Style["     pitch          ",Italic,White]," = ",NumberForm[pitch,{5,3}]}],18,White],
Style[Row[{Style["     rise            ",Italic,White]," = ",NumberForm[rise,{5,3}]," ft."}],18,White],
Style[Row[{Style["     height        ",Italic,White]," = ",NumberForm[b ratio,{5,3}]," ft."}],18,White],
Style[Row[{Style["   total height",Italic,White],"   = ",NumberForm[totalheight,{5,3}]," ft."}],18,White],
Style[Row[{Style["area of fig.",Italic,White]," = ",NumberForm[area1[alpha],{5,3}],"  ",Superscript[ft,2] }],24,Italic,White],
Spacer[{0,12}],
Show[pltarea1,greenpt1,ImageSize->Medium]
}]
(*Show[pltarea1,greenpt1,ImageSize->Medium,PlotRange->All]*)
]
}]
],
Frame->True,ItemSize->Medium]
}],

Grid[{{Control[
{{p,8,"perimeter"},6.,15.,ImageSize->Tiny,Appearance->"Labeled"}],Control[
{{ratio,0.633975,"ratio height to width"},0.36,1.,ImageSize->Tiny,Appearance->"Labeled"}]},{Control[
{{alpha,π/3,"vertex\n angle"},π/12,2π/3,0.00001,ImageSize->Tiny,Appearance->"Labeled"}],Control[
{{showmax,False,"show Max "},{False,True}}],Control[{{answer,False,"Answer "},{False,True}}]}}],TrackedSymbols->{p,ratio,alpha,showmax,answer},SaveDefinitions->True(*ContentSize->{970, 840}*)]

Norman Window:
 ( a rectangle topped by a semi circle ) 6 - 28 - 14:

Given a fixed Perimeter, maximize the content area.

Manipulate[
Column[{
Item[Style[Row[{Style["\nCalculate the dimensions that maximize the area of\n Norman Window if its perimeter is ",Italic],TraditionalForm[p,{4,2}],Style[" feet \n",Italic]}],16,Purple],Frame->True,Alignment->{Center}],
Item[
normanArea[b_]:=FullSimplify[p b/2.-((4+Pi)/8.)(b^2)];
r=b/2;
height=Expand[p/2. - b(π+2)/4.];
totalHeight=Expand[height+r];
bmax=Expand[2. p/(4+Pi)];
rmax=Expand[p/(π+4.)];
maxArea=(π+4.)bmax^2/8;
If[showMax,b=bmax];

areaPlot=Plot[normanArea[x],{x,0,5},PlotStyle->{Thick,Purple},PlotRange->{{0,5.7},Automatic},AxesLabel->{Style[window width x,12],Style["Content Area",12]},PlotLabel->Style[Row[{"Area of Norman window"}],18],ImageSize->Medium];
pointOnCurve=If[showMax,Graphics[{PointSize[0.035],Red,Point[{bmax,maxArea}]}],
Graphics[{PointSize[Large],RGBColor[.25,.75,.25],Point[{b,normanArea[b]}]}]];

NormanWindow=If[showMax,Graphics[{{EdgeForm[{Thick,Blue}],FaceForm[Pink],Polygon[{{0,0},{0,bmax/2},{bmax,rmax},{bmax,0}}],Disk[{rmax,rmax},rmax,{0,π}]},{Thick,Pink,Line[{{0.03,rmax},{bmax-0.03,rmax}}],PointSize[0.025],Blue,Point[{rmax,rmax}]},
Line[{{0,0},{0,-0.8}}],Line[{{bmax,0},{bmax,-0.8}}],
Line[{{bmax,0},{bmax+1.2,0}}],Line[{{ bmax,rmax},{ bmax+0.8,rmax}}],
Line[{{ rmax,bmax},{ bmax+1.2,bmax}}],
Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{bmax,-0.7}}],Arrow[{{b+0.7,0},{b+0.7,height}}],Arrow[{{bmax+0.7,height},{b+0.7,rmax+height}}],Arrow[{{b+1.1,0},{b+1.1,height + rmax}}],{Thick,Black,Arrowheads[0.05],Arrow[{{rmax,rmax},{rmax+rmax Cos[π/4],rmax+rmax Cos[π/4]}}]},

If[answer,{Text[Style[Row[{Style["area of fig.",Italic],"\n = ",NumberForm[maxArea,{5,3}],"  ",Superscript[ft,2] }],16,Black],{b/2,height-0.5}],
Text[Style[Row[{Style["width",Italic]," = ",NumberForm[b,{4,3}],Style[" ft"]}],12,Purple],{b/2,-0.5}],Rotate[Text[Style[Row[{Style["height",Italic]," = ",NumberForm[rmax,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,height/2.}],π/2],
Rotate[Text[Style[Row[{Style["Radius",Italic],"\n = ",NumberForm[rmax,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,height+b/4.}],π/2],
Rotate[Text[Style[Row[{Style["total height",Italic],"\n = ",NumberForm[bmax,{4,3}],Style[" ft"]}],12,Purple],{b+1.1,(height+rmax)/2.}],π/2]
}]

},Axes->True],

Graphics[{{EdgeForm[{Thick,Blue}],FaceForm[Yellow],Polygon[{{0,0},{0,height},{b,height},{b,0}}],Disk[{b/2,height},r,{0,π}]},{Thick,Yellow,Line[{{0.03,height},{b-0.03,height}}],PointSize[0.025],Blue,Point[{r,height}]},Line[{{0,0},{0,-0.8}}],Line[{{b,0},{b,-0.8}}],
Line[{{b,0},{b+1.2,0}}],Line[{{ b,height},{ b+0.8,height}}],
Line[{{ b/2,r+height},{ b+1.2,r+height}}],
Arrowheads[{-0.03,0.03}],Arrow[{{0,-0.7},{b,-0.7}}],Arrow[{{b+0.7,0},{b+0.7,height}}],Arrow[{{b+0.7,height},{b+0.7,r+height}}],Arrow[{{b+1.1,0},{b+1.1,height + r}}],

If[answer,{Text[Style[Row[{Style["area of fig.",Italic],"\n = ",NumberForm[normanArea[b],{5,3}],"  ",Superscript[ft,2] }],16,Black],{b/2,height-0.5}],
Text[Style[Row[{Style["width",Italic]," = ",NumberForm[b,{4,3}],Style[" ft"]}],12,Purple],{b/2,-0.5}],Rotate[Text[Style[Row[{Style["height",Italic]," = ",NumberForm[height,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,height/2.}],π/2],
Rotate[Text[Style[Row[{Style["Radius",Italic],"\n = ",NumberForm[b/2.,{4,3}],Style[" ft"]}],12,Purple],{b+0.5,height+b/4.}],π/2],
Rotate[Text[Style[Row[{Style["total height",Italic],"\n = ",NumberForm[totalHeight,{4,3}],Style[" ft"]}],12,Purple],{b+1.1,(height+r)/2.}],π/2]
}]},Axes->True]
];

Row[{Show[NormanWindow,ImageSize->Medium,PlotRange->{{0,5.5},{-1.1,6}}],Show[areaPlot,pointOnCurve,ImageSize->Medium]
}],Frame->True]
}],
Row[{Control[
{{p,10,"Perimeter"},6,15.,ImageSize->Tiny,Appearance->"Labeled"}],Control[
{{b,2,"window width, x"},0.42,4.5,ImageSize->Tiny,Appearance->"Labeled"}],Spacer[30],Control[{{showMax,False,"show Max"},{False,True}}],Control[{{answer,False,"Answer"},{False,True}}]}],TrackedSymbols->True]

Volume of the Wedge

A right circular cylinder is cut by two planes to form a wedge.  One plane is perpendicular to the axis of the cylinder and the second makes an angle theta degrees with the first. Calculate the volume of the wedge for any angle theta.

Based on problem # 55 of Section 6.2 at Page 423; Calculus 5 th Edition by Larson Hostetler & Edwards.

ClearAll["Global`*"];

Manipulate[
Column[{Item[If[answer,Text@Style[Row[{Style["\nVolume of Wedge = ",Blue,Italic],Style[volume,Blue],Style["  cubic units \n",Blue,Italic]}],18],Text@Style["\nCalculate the volume of the wedge giving the angle of the cut α\n",16,Italic]],Alignment->Left,Frame->True],
Item[
(* Displaying the floor of the Wedge *)
rpb=If[top,{RevolutionPlot3D[{t,Tan[α]},{t,0,1},{φ,0,ang},Mesh-> 5, Lighting-> "Neutral",PlotStyle-> {GrayLevel[0.99]}],RevolutionPlot3D[{{t ,0}},{t,0,1.},{θ,0,π},Boxed->False]},RevolutionPlot3D[{{t ,0}},{t,0,1.},{θ,0,π},Boxed->False]];

(*pcl=If[showall,{ParametricPlot3D[{Cos[u],Sin[u],ht},{u,0,ang},{ht,0,Tan[α]},Mesh->5,BoundaryStyle->{Black}(*,PlotStyle->Texture[ImageCrop[grp]]*),Boxed->False, Lighting-> "Neutral"],Plot3D[{Tan[α]},{x,-1,1},{y,0,1},RegionFunction->Function[{x,y,z},x^2 +y^2<1]

(*[{x,y,z},x^2+y^2<1]*) ,Mesh-> None,PlotStyle-> {GrayLevel[0.99]}]},{}];*)

(* Display the top *)

pcl=If[showside,{ParametricPlot3D[{Cos[u],Sin[u],ht},{u,0,ang},{ht,0,Tan[α]},Mesh->5,BoundaryStyle->{Black}(*,PlotStyle->Texture[ImageCrop[grp]]*),Boxed->False, Lighting-> "Neutral"](*RevolutionPlot3D[{t,Tan[α]},{t,0,1},{φ,0,ang},Mesh-> 5, Lighting-> "Neutral",PlotStyle-> {GrayLevel[0.99]}]*)},{}];




(*cylb=ParametricPlot3D[{Cos[θ],Sin[θ],z},{θ,0, π},{z,0,Tan[α]},Boxed->False,PlotStyle->{Opacity[.6](*,EdgeForm[Opacity[.7]]*)},Mesh->10];
(*cylhalf=Graphics3D[{Opacity[.3],EdgeForm[Opacity[.3]],Cylinder[]},*)PlotRange->{{-1,1},{0,-1},{0,(Sqrt[3])}}];*)
grp:=Graphics3D[{{Black,Thick,Line[{{-1,0,0},{1,0,0}}]},
{Table[{{Thick,Red,Line[{{-1+k dv,(Sqrt[1-(-1+k dv)^2]),(Sqrt[1-(-1+k dv)^2])Tan[α]},{-1+(k+1) dv,(Sqrt[1-(-1+(k+1) dv)^2]),(Sqrt[1-(-1+(k+1) dv)^2])Tan[α]}}]},{Dashing[0.03],Thick,Blue,Line[{{-1+k dv,(Sqrt[1-(-1+k dv)^2]),0.0},{-1+(k+1) dv,(Sqrt[1-(-1.+(k+1) dv)^2]),0.0}}]},

{Darker[Green],Line[{{-1+k dv,(Sqrt[1-(-1+k dv)^2]),0},{-1+k dv,(Sqrt[1-(-1+k dv)^2]),(Sqrt[1-(-1+k dv)^2])Tan[α]}}]}


},{k,0,199,1}]},
Table[{ColorFunction->"Rainbow",

Polygon[{{u,0,0},{u,y,0},{u,y,h},{u,0,0.}}],  (*First Side *)
Polygon[{{u+du,0,0},{u+du,y3,0},{u+du,y3,h3},{u+du,0,0}}], (*Second Side *)
Polygon[{{u,0,0},{u+du,0,0},{u+du,y3,0},{u,y,0}}], (*Bottom Polygon *)Polygon[{{u,0,0},{u,y,h},{u+du,y3,h3},{u+du,0,0}}],(* Front Polygon *)Polygon[{{u,y,0},{u+du,y3,0},{u+du,y3,h3},{u,y,h}}]},{u,-0.8,0.8,0.4}],

(* The moving polygon *)

(*Bottom polygon *)
Polygon[{{x,0,0},{x+dx,0,0},{x+dx,y2,0},{x,y1,0}}],
(* Back Polygon *)
 Polygon[{{x,y1,0},{x+dx,y2,0},{x+dx,y2,h2},{x,y1,h1}}],
(* two sides polygons *)
{RGBColor[0,0.6,1],Polygon[{{x+dx,0,0},{x+dx,y2,0},{x+dx,y2,h2}}]}, 
{EdgeForm[Red],FaceForm[LightYellow],Polygon[{{x,0,0},{x,y1,0},{x,y1,h1},{x,0,0.}}]},

(* Front Polygon *)
{EdgeForm[{Thick,Red}],FaceForm[Blue],Polygon[{{x,0,0},{x,y1,h1},{x+dx,y2,h2},{x+dx,0,0}}]}
(*   ,If[showall,{ Lighting-> "Neutral",BoundaryStyle->Black,Opacity[0.3],

(*FaceForm[LightOrange],EdgeForm[Directive[Dashed,Thick,Blue]],Opacity[.7],EdgeForm[Opacity[.2]],*)
  
Cylinder[{{0,0,0},{0,0,Tan[α]}},1]},{}]   *)

}];
Show[grp,rpb,pcl,ImageSize->400,Boxed->False],Alignment->{Center},Frame->True]}],
Grid[{
{Control[
{{α,π/3,"angle of cut"},π/12,5 π/12,π/12,ImageSize->Tiny,Appearance->"Labeled"}],Control[
{{ang ,2π,"angle"},π/720,2.π,π/720.,Appearance->"Labeled",ImageSize->Tiny}]},{Control[
{{x,0,"Prism"},-0.8,0.8,0.2,Appearance->"Labeled",ImageSize->Tiny}],Control[
{{dx,0.2,"Δx"},0.04,0.2,0.02,Appearance->"Labeled",ImageSize->Tiny}]},
{Control[
{{answer,False,"Answer"},{False,True}}],Control[{{top,True,"Show Top"},{False,True}}],Control[{{showside,True,"Show Side"},{False,True}}] }}],
TrackedSymbols->{α,ang,top,x,dx,answer,showside},Initialization->{y1:=(Sqrt[1.-x^2]);h1:=y1 Tan[α];
y2:=(Sqrt[1.-(x+dx)^2]);
h2:=y2 Tan[α];
y:=(Sqrt[1-u^2]);
du:=0.2;dv:=0.01;
y3:=(Sqrt[1-(u+du)^2]);
h3:=y3 Tan[α];
h:=((Sqrt[1-u^2]) )Tan[α];
volume=FullSimplify[ (∫_0^1)((1-w^2)Tan[α])\[DifferentialD]w];},SaveDefinitions->True]

Minimum and Maximum Area of a Triangle in a Square

6 - 30 - 14

Example:
Find the minimum and maximum area of a triangle in a square whose vertex is on the quarter circle of the square.

ClearAll["Global`*"];
x[u_]:=1/(2 Cos[u]);
y[u_]:=1/(2Sin[u]);
areacheck[u_]:=1/(4 Sin[2 u]);

Manipulate[

Column[{

Item[
Which[smallestArea,
Style[Row[{Style["\nMinimum Area = ",Italic],TraditionalForm[1/(4 Sin[ π/2])]," ",Superscript[in,2],"\n"}],18,Purple],
largestArea1,

Style[Row[{Style["\nMaximum Area = ",Italic],TraditionalForm[1/(4 Sin[ π/3])]," ",Superscript[in,2],"\n"}],18,Purple],

largestArea2,
Style[Row[{Style["\nMaximum Area = ",Italic],TraditionalForm[1/(4 Sin[ 2π/3])]," ",Superscript[in,2],"\n"}],18,Purple],

True,
Style["\nWhat is the smallest and largest areas that\nthe shaded triangular region can have?\n",21,Italic, Black]],Alignment->{Center},Frame->True,ItemSize->{45,3}],

Item[
plot1=Plot[1/(4 Sin[2 T]),{T,π/180,π/3},PlotStyle->{Thick,Blue},AxesOrigin->{0,0},Axes->True,AspectRatio->Automatic,AxesOrigin->{0,0},PlotRange->{{-0.1,1.4},{-0.1,0.75}},Ticks->{{0,π/12,π/6, π/4,π/3,5π/12},{0,0.2,0.4,0.6}},AxesLabel->{"m ∠ BCP"," Area of Δ"},LabelStyle->Directive[12,Bold],GridLines->{Range[0,π/2,π/12],Range[-0.2,0.6,0.2]},ImageSize->Medium,GridLinesStyle->Directive[RGBColor[0,0.6,1]],

Epilog->{Purple,PointSize[0.02],If[smallestArea,{
Point[{π/4,areacheck[π/4]}],Inset[Style[Row[{"{ ",NumberForm[π/4 , 2] ,",  ", N[areacheck[π/4],3]," }"}],12,Bold],{π/4, areacheck[π/4]-0.15}],Arrowheads[0.05],Thick,Arrow[{{0,0},{π/4,0}}],Arrow[{{0,0},{0,0.75}}]},If[largestArea1,{Point[{π/6,areacheck[π/6]}],Inset[Style[Row[{"{ ",NumberForm[π/6 , 2] ,",  ", N[areacheck[π/6],3]," }"}],12,Bold],{π/6, areacheck[π/6]-0.15}],Arrowheads[0.05],Thick,Arrow[{{0,0},{π/6,0}}]},
If[largestArea2,{Point[{π/3,areacheck[π/3]}],Inset[Style[Row[{"{ ",NumberForm[π/3 , 2] ,",  ", N[areacheck[π/3],3]," }"}],12,Bold],{π/3, areacheck[π/3]-0.15}],Arrowheads[0.05],Thick,Arrow[{{0,0},{π/3,0}}]},
{Point[{t,areacheck[t]}],Inset[Style[Row[{"{ ",NumberForm[t , 2] ,",  ",N[areacheck[t],3]," }"}],12,Bold],{t,areacheck[t]-0.15}],Arrowheads[0.05],Blue,Thick,Arrow[{{0,0},{6π/12,0}}],Arrow[{{0,0},{0,0.75}}]}
]]]
}];


frame[t_]=Graphics[{

Inset[Style["A",18,Bold],{-0.05,-0.05}],Inset[Style["B",18,Bold],{x[t],-0.05}],Inset[Style["C",18,Bold],{-0.05,y[t]}],
{Purple,Arrowheads[{-0.04,0.04}],Arrow[{{0.0,-0.09},{x[t],-0.09}}],Arrow[{{-0.09,0},{-0.09,y[t]}}]},Inset[Row[{Style["x",14,Italic]," = ",x[t]}],{x[t]/2,-0.04}],
Inset[Row[{Style["y",14,Italic]," = ",y[t]}],{-0.06,y[t]/2}],
{ Thick,Line[{{x[t],0},{1,0}}],
Line[{{0,y[t]},{0,1}}],Line[{{0,1},{1,1}}],Line[{{1,1},{1,0}}]},{Dashing[0.01],Line[{{0,0},{x[t],0}}],Line[{{0,0},{0,y[t]}}]},
Red,Circle[{0,0},1,{0,π/2}]},ImageSize->Medium,PlotRange->{{-0.21,1.12},{-0.3,1.12}}];

triangle=Graphics[{
{{EdgeForm[Red],FaceForm[Yellow],Polygon[{{x[t],0},{Cos[t],Sin[t]},{0,y[t]}}]},
{PointSize[0.025],Red,Point[{Cos[t],Sin[t]}]},Inset[Style["P",18,Bold,Purple],{Cos[t]+0.03,Sin[t]+0.03}]}},ImageSize->Medium,PlotRange->{{-0.21,1.12},{-0.3,1.12}}];

smallertriangle=Graphics[{
{EdgeForm[Blue],FaceForm[Pink],Polygon[{{x[π/4],0},{Cos[π/4],Sin[π/4]},{0,(1- x[π/4]  Cos[π/4])/Sin[π/4]}}]},
{PointSize[0.025],Red,Point[{Cos[π/4],Sin[π/4]}]},Inset[Style["P",18,Bold,Purple],{Cos[π/4]+0.03,Sin[π/4]+0.03}]
},ImageSize->Medium,PlotRange->{{-0.21,1.12},{-0.3,1.12}}];
largetriangle1=Graphics[{{EdgeForm[Blue],FaceForm[Pink],Polygon[{{x[π/6],0},{Cos[π/6],Sin[π/6]},{0,(1- x[π/6] Cos[π/6])/Sin[π/6]}}]},
{PointSize[0.025],Red,Point[{Cos[π/6],Sin[π/6]}]},Inset[Style["P",18,Bold,Purple],{Cos[π/6]+0.03,Sin[π/6]+0.03}]},ImageSize->Medium,PlotRange->{{-0.21,1.12},{-0.3,1.12}}];

largetriangle2=Graphics[{{EdgeForm[Blue],FaceForm[Pink],Polygon[{{x[π/3],0},{Cos[π/3],Sin[π/3]},{0,(1- x[π/3] Cos[π/3])/Sin[π/3]}}]},
{PointSize[0.025],Red,Point[{Cos[π/3],Sin[π/3]}]},Inset[Style["P",18,Bold,Purple],{Cos[π/3]+0.03,Sin[π/3]+0.03}]},ImageSize->Medium,PlotRange->{{-0.21,1.12},{-0.3,1.12}}];


Row[{Show[If[smallestArea,{smallertriangle,frame[π/4]},If[largestArea1,{largetriangle1,frame[π/6]},If[largestArea2,{largetriangle2,frame[π/3]},{frame[t],triangle}]]],PlotRange->{{-0.21,1.12},{-0.3,1.12}}],Spacer[30],Show[plot1]}],Frame->True,ItemSize->{21,3}]
}],


Row[{Control[{{t,π/5,"∠ BCP"},π/6,π/3,π/72,ImageSize->Tiny,Appearance->"Labeled"}],Spacer[30],
Control[
{{smallestArea,False,"Minimum Area"},{False,True},Enabled->!largestArea1}],Spacer[30],
Control[
{{largestArea1,False,"Largest Area1"},{False,True},Enabled->!smallestArea}],
Spacer[30],Control[{{largestArea2,False,"Largest Area2"},{False,True},Enabled->!largestArea1}]}],
TrackedSymbols->{t,x,smallestArea,largestArea1,largestArea2},SaveDefinitions->True(*,ContentSize->{960,630}*)]